<!--
 * @Author: deng da chao
 * @Date: 2022-05-24 15:07:53
 * @LastEditTime: 2023-10-10 17:04:39
 * @Description: 商品商品列表
-->
<template>
  <view class="buy_li pos_r" @click="goDetails">
    <view class="sale-box pos_a">
      <!-- 售卖中 -->
      <template v-if="item.revenueExpenType == 3">
        <image mode="widthFix" src="@/static/image/buy/sale-icon2.png" />
      </template>
      <!-- 交易中 -->
      <template v-else-if="item.revenueExpenType == 4">
        <image mode="widthFix" src="@/static/image/buy/sale-icon3.png" />
      </template>
    </view>
    <view class="exhibits pos_r">
      <image
        class="exhibits_img"
        mode="aspectFill"
        :lazy-load="true"
        :src="item.mainImg"
      ></image>
    </view>
    <view class="title_div">
      <view class="title clamp1">{{ item.title }}</view>
      <view class="tag_ul flex_start flex_items">
        <span class="serial_number_tag flex_start flex_items">
          <image mode="widthFix" src="@/static/image/buy/buy_li_icon.png" alt="" />
          <span class="clamp1">{{ item.selfAccretionStr }}</span>
        </span>
      </view>
    </view>
  </view>
</template>
<script>

export default {
  name: "buy_li",
  props: {
    item: { type: Object, default: () => {} },
  },
  data() {
    return {
    };
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    cancelResell() {
      this.$functions.showWaiting();
      this.$api.market
        .putSysMemberNftCancelSell({ memberNftId: this.item.sid })
        .then((e) => {
          this.$functions.success("取消成功", () => {
            this.item.revenueExpenType = 6;
          });
        });
    },
    
    goDetails() {
      const { id, nftType, revenueExpenType } = this.item;
      if (revenueExpenType == 11) {
        this.$functions.error("该商品锁定中...");
        return;
      }
      let url = `/pages/goods/buyDetails?id=${id}`;
     uni.navigateTo({
       url: url,
     });
    },
  },
};
</script>
<style scoped lang="scss">
.buy_li {
  width: 100%;
  border-radius: 32rpx;
  margin-bottom: 32rpx;
  background: #ffffff;
  overflow: hidden;
  padding: 8rpx;
  box-sizing: border-box;

  .exhibits {
    width: 100%;
    position: relative;
    height: 316rpx;
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 32rpx;
    overflow: hidden;
    .exhibits_img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      box-sizing: border-box;
    }
  }

  .title_div {
    padding: 16rpx 8rpx 18rpx 8rpx;

    .energy_div {
      white-space: nowrap;
      width: 100%;
    }

    .title {
      font-family: PingFang SC, PingFang SC-Medium;
      font-weight: 500;
      font-size: 30rpx;
      color: #222222;
      margin-bottom: 16rpx;
    }
  }
}

.sale-box {
  top: 8rpx;
  left: 8rpx;
  width: 124rpx;
  z-index: 111;

  & > image {
    width: 100%;
  }
}
</style>
